<?php
    function debugMsg($message)
    {
        if ($GLOBALS['debugMode'])
        {
            //echo $message;
            chmod($GLOBALS['debugFile'], 0755);
            $fd = fopen ($GLOBALS['debugFile'], "a");
            fwrite ($fd, date("d/m/y H:i")." ".$message . "\r\n");
            fclose ($fd);
        }
    }

?>